import 'package:flutter/material.dart';

main() {
  runApp(WarpApp());
}

class WarpApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      theme: ThemeData(primaryColor: Colors.green),
      home: Scaffold(
        appBar: AppBar(
          title: Text('wrap'),
        ),
        body: WarpContent(),
      ),
    );
  }
}

class WarpContent extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Wrap(
      spacing: 5,//横向间距
      runSpacing: 5,//竖直间距
      children: [
        ElevatedButton(

          onPressed: () {},
          child: Text('复仇者联盟', style: TextStyle(color: Colors.black, fontSize: 12),),
          style: ButtonStyle(
            side: MaterialStateProperty.all(BorderSide(color: Colors.lightBlue, width: 1)),
              backgroundColor: MaterialStateProperty.all(Colors.white)),
              // backgroundColor: MaterialStateProperty.all(Colors.amber)),

        ),
        ElevatedButton(
          onPressed: () {},
          child: Text(
            '冰与火之歌',
            style: TextStyle(color: Colors.yellow),
          ),
        ),
        ElevatedButton(onPressed: () {}, child: Text('破产姐妹')),
        ElevatedButton(onPressed: () {}, child: Text('塑料姐妹花')),
        ElevatedButton(onPressed: () {}, child: Text('行尸走肉')),
        ElevatedButton(onPressed: () {}, child: Text('情人')),
      ],
    );
  }
}
